package com.example.tests;

import org.testng.annotations.Test;
import com.example.fw.Folders;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;

public class FolderRemovalTest extends TestBase {

	@Test
	public void folderRemovalTest(){
		
		String folder = "FolderForDelete";
		app.getFolderHelper().createFolder(folder);
		
		Folders oldFolders = app.getFolderHelper().getFolders();
		app.getFolderHelper().deleteFolder(folder);
		Folders newFolders = app.getFolderHelper().getFolders();
		assertThat(newFolders, equalTo(oldFolders.without(folder)));
	}
	
	@Test
	public void folderVariousRemovalTest(){
		
		String folder1 = "FolderForDelete1"; 
		String folder2 = "FolderForDelete2"; 
		app.getFolderHelper().createFolder(folder1);
		app.getFolderHelper().createFolder(folder2);
		
		Folders oldFolders = app.getFolderHelper().getFolders();
		app.getFolderHelper().deleteFolder(folder1);
		Folders newFolders = app.getFolderHelper().getFolders();
		assertThat(newFolders, equalTo(oldFolders.without(folder1)));
		
		app.getFolderHelper().deleteFolder(folder2);
		Folders newFolders2 = app.getFolderHelper().getFolders();
		assertThat(newFolders2, equalTo(newFolders.without(folder2)));
	}
	
}

